<template>
	<div class="swiper">
		<swiper :options="swiperOption" v-if="list.length">
			<swiper-slide v-for="item in list" :key="item.id">
				<img class="swiper-img" :src="item.imgUrl" alt="">
			</swiper-slide>
			<div class="swiper-pagination"  slot="pagination"></div>
		</swiper>
	</div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
  	list: Array
  },
  data () {
    return {
    	swiperOption: {
    		pagination: '.swiper-pagination',
    		loop: true,
    		autoplay: 3000,
    		autoplayDisableOnInteraction: false
    	}
    }
  }
}
</script>

<style lang="stylus" scoped>
	@import "~styles/variable.styl"
	
	// >>>穿透scoped，修改第三方组件样式
	.swiper >>> .swiper-pagination-bullet-active 
	  background: #fff
	.swiper
		padding-bottom: 26.67%
		width: 100%
		height: 0
		overflow: hidden
		background:$white
		.swiper-img
			width: 100%
</style>
